<?php
/**
 *
 */
class mlogin extends CI_Model {

  public function __construct() {
    parent::__construct();
    $this->load->database();
  }
  public function getlogin($username,$password,$utype){
    if(!$username || !$password || !$utype)return false;
    $query = $this->db->query('select * from users where username="'.$username.'" && password="'.$password.'"');
    if($utype ==2){
      $query = $this->db->query('select * from employees where emid="'.$username.'" && password="'.$password.'"');
    }
    if($query->num_rows()>0){
      return true;
    }else{
      return false;
    }
  }
  public function insertgo($time,$emid){
    for ($i=0; $i <=10000 ; $i++) {
      $this->db->simple_query("insert INTO summary(shopid,bid,content,getboss,inshop,joinv,meet,outcount,outday,pass,seeboss,sellcar,tecount,addday,emid,skcount) VALUES ( '1055', '24', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '11', ".strtotime($time).", '".$emid."', '1')");
    }
    return true;
  }
  public function outsummarygo(){
    return $this->db->query('select * from summary')->result_array();
  }
}
